package cn.gqr.mapper;

import cn.gqr.entity.Book;
import cn.gqr.entity.BookType;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface BookMapper extends BaseMapper<Book> {


    /**查询全部书本信息并且分页 typeId==null,查找全部信息,不等于空根据typeId查找**/
    List<BookType> selectBookByPage(@Param("start") int start,@Param("num")int num,@Param("typeId") Integer typeId,@Param("key")String key);

    /**查询全部书本信息的总行数*/
    int  selectBookByPageTotal(@Param("typeId") Integer typeId);

    /**获取点赞或者销量或者加入购物车前五的书本对象**/
    List<Book> selectData5(String key);


}
